<?php
/**
 * Created by PhpStorm.
 * User: chengenghong
 * Date: 2021-09-18
 * Time: 15:54
 */


function Builder(G244\Builder\Director $director)
{
    $builder = new G244\Builder\ConcreteBuilder1();
    $director->setBuilder($builder);

    echo "Standard basic product:\n";
    $director->buildMinimalViableProduct();
    $builder->getProduct()->listParts();

    echo "Standard full featured product:\n";
    $director->buildFullFeaturedProduct();
    $builder->getProduct()->listParts();

    // Remember, the Builder pattern can be used without a Director class.
    echo "Custom product:\n";
    $builder->productPartA();
    $builder->productPartC();
    $builder->getProduct()->listParts();
}

